layui.config({
  base: ctxPath //假设这是你存放拓展模块的根目录
}).extend({ //设定模块别名
  murl: 'url' //如果 mymod.js 是在根目录，也可以不用设定别名
});
layui.use(['element','murl','form','upload','layedit'], function () {
     var element = layui.element,
     					form = layui.form,
     					upload = layui.upload,
     					layedit = layui.layedit,
         murl=layui.murl,id = murl.get("id");

    $.ajax({
        url: "/api/policy/news/"+id,
        type: 'get',
        dataType: "json",
        success: function (data) {
            if(data.rel){
                setLabelValues(data.result);
                setInputValues(data.result);
            }else{
                layerTips.msg(data.msg);
            }
        }
    });


});

function setLabelValues(data) {
    for (var p in data) {
        $("#" + p + "").html(data[p]);
    }
}

function setInputValues(data) {
    for (var p in data) {
        $("#" + p + "").val(data[p]);
    }
}



